﻿<?php
	/*老师模糊查询表格           根据id搜索*/
 	('Access-Control-Allow-Origin：*');
	include("mysql.php");
	 $searchText = $_REQUEST['searchText'];
     $id = $_REQUEST['id'];
     $scale = $_REQUEST['scale'];

	/*查询语句 一级管理员和二级管理员*/
     if($scale==1 || $scale==4){
    	 $sql = "select * from teachers where id !=0 and tname like '%{$searchText}%' order by id desc";
    }
    else{
    	 $sql = "select * from teachers where id ='".$id."'";
    }
     /*创建新的连接对象并使用new 对象的方法*/
    $Mysql = new Mysql();
       /*根据查询语句返回列表*/
     $arrsd = $Mysql->likeSelect($sql);
	/*返回出去*/
	echo $arrsd;
	/*关闭连接*/
    $Mysql->close();

?>